﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SMG.Domain.Specifications.Program;

using SMG.Domain.Model.Program;
using SMG.Domain.Repository;
using SMG.Domain.Repository.Program;

namespace Infrastructure.Repository.EntityFramework.Program
{
    /// <summary>
    /// 设备仓储实现
    /// </summary>
    public class DeviceRepository : EntityFrameworkRepository<Device>, IDeviceRepository
    {
        public DeviceRepository(IRepositoryContext context) :
            base(context) { }


        /// <summary>
        /// 根据折别ID获取设备信息
        /// </summary>
        /// <param name="deviceId"></param>
        /// <returns></returns>
        public Device GetDeviceByID(string deviceId)
        {
            var device = base.QueryBy(new DeviceDIdEqualSpecification(deviceId)).FirstOrDefault();
            return device;
        }
    }
}
